
from question import Question

def skip_to(label):
    print "hi"
    pass



if __name__ == "__main__":

    q1 = Question()
    q2 = Question()
    q3 = Question()
    q1.text = "How old are you?"
    q1.post_proc = "skip_to(q3)"
    q2.text = "Have you gone to school?"
    q3.text = "Where do you come from?"

    xs = [q1, q2, q3]
    for q in xs:
        print q
        cstr = q.post_proc
        from code import compile_command
        cod = compile_command(cstr)
        exec cod


    #x = NumberQuestion()
    #x.set_minmax(10, 30)
    #print x.set_value(12)



    print ""
    print ""


    variables = ["ivar", "petter", "hawman"]

    for var in variables:
        code_string = "%s = 'heh'" % (var)
        from code import compile_command
        try:
            print 'Trying to execute: "%s"' % (code_string)
            cod = compile_command(code_string)
            exec cod
        except:
            pass

    print "ivar is %s" % (ivar)
    print "petter is %s" % (petter)
    print "hawman is %s" % (hawman)

